#include <vector>
#include <GL\glut.h>
#include "Cell.h"
#include "Wall.h"

Cell::Cell() : size(0.0f), code(0.0f)
{
}

Cell::Cell(std::vector<Wall> _walls,Wall _floor,
		   float positionX,float positionY,float positionZ,
		   float _size,char _code) : size(_size), code(_code), walls(_walls), floor(_floor)
{
	setPosition(positionX,positionY,positionZ);	
}

Cell::Cell(std::vector<Wall> _walls, Wall _floor, 
		   Vector3f& Position, float _size, char _code) : walls(_walls), floor(_floor), size(_size), code(_code)
{
	setPosition(Position);
}

void Cell::Draw()
{
	glPushMatrix();	
	
	glTranslatef(position[0], position[1], position[2]);
	
	glScalef(size,size,1);

	floor.Draw(true);

	for(unsigned int i = 0; i < walls.size(); i++)
	{
		walls[i].Draw(false);
	}

	glTranslatef(-position[0], -position[1], -position[2]);
	glPopMatrix();
};

void Cell::AddWall(Wall w){
	walls.push_back(w);	
}

void Cell::Clear()
{
	walls.clear();
}

